
function  Promotion(){
   this.promotionName=[ "可口可乐","雪碧","方便面"];
}
Promotion.prototype={
    computePromotionCount:function(itemInfo){
        var promotionCount=(this.promotionName.indexOf(itemInfo.get('itemName'))>-1)?parseInt(itemInfo.get('count')/3):0;
        itemInfo.set('promotionCount',promotionCount);
        return itemInfo
    },
    computeSavePrice:function(itemInfo){
        var savePrice=itemInfo.get('price')*itemInfo.get('promotionCount');
        itemInfo.set('savePrice',savePrice);
        return itemInfo
    }
}
